﻿@using hc.epm.Common;
@using hc.Plat.Common.Extend;
@using hc.epm.DataModel.Basic;
@using hc.epm.ViewModel;
@model CompanyView
@{
    ViewBag.Title = "承包商管理详情";
}

<link href="~/Resource/css/ProjectManagement.css" rel="stylesheet" />

<div class="contentData">
    <form class="form-horizontal" id="mainForm">
        <div class="module-div">
            <h4>基本信息</h4>
            <table class="datalist" style="word-break:break-all;word-wrap:break-word;margin-top:10px;">
                <tbody>
                    <tr>
                        <td class="table_title">承包商名称：</td>
                        <td class="td-div" colspan="3">
                            <div class="form-group">@Model.Name</div>
                        </td>
                    </tr>

                    <tr>
                        <td class="table_title">承包商电话：</td>
                        <td class="td-div">
                            <div class="form-group">@Model.Phone</div>
                        </td>
                        <td class="table_title">承包商传真：</td>
                        <td class="td-div">
                            <div class="form-group">@Model.FaxPhone</div>
                        </td>
                    </tr>
                    <tr>
                        <td class="table_title">邮箱地址：</td>
                        <td class="td-div">
                            <div class="form-group">@Model.Email</div>
                        </td>
                        <td class="table_title">所在地区：</td>
                        <td class="td-div">
                            <div class="form-group">@Model.AddressName</div>
                        </td>
                    </tr>
                    <tr>
                        <td class="table_title">是否黑名单：</td>
                        <td class="td-div">
                            <div class="form-group">
                                @if (Model.IsBlacklist == true)
                                {
                                    <div>是</div>
                                }
                                @if (Model.IsBlacklist == false)
                                {
                                    <div>否</div>
                                }
                            </div>
                        </td>
                        <td class="table_title"><i class="color_red_x">*</i>承包商类型：</td>
                        <td class="td-div" colspan="3">
                            <div>@Model.CompanyTypeName</div>
                        </td>
                    </tr>
                    <tr>
                        <td class="table_title"><i class="color_red_x">*</i>承包商级别：</td>
                        <td class="td-div">
                            <div>@Model.CompanyRankName</div>
                        </td>
                        <td class="table_title">详细地址：</td>
                        <td class="td-div" colspan="3">
                            <div class="form-group">@Model.AddressInfo</div>
                        </td>
                    </tr>
                    <tr>
                        <td class="table_title">简介：</td>
                        <td class="td-div" colspan="3" style="height:100px;">
                            <div class="form-group">@Model.Remark</div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>

        <div class="module-div">
            <h4>附件上传</h4>
            <table class="datalist fileShow" style="word-break:break-all;word-wrap:break-word;margin-top:10px;">
                <tbody class="fileShow-append">

                    <tr class="headtr">
                        <th class="table_title" style="width: 219px;">序号</th>
                        <th class="td-div">附件名称</th>
                        <th class="table_title">附件类型</th>
                        <th class="td-div">操作</th>
                    </tr>
                    @if (Model.baseFiles != null)
                    {
                        int index = 0;
                        if (Model.baseFiles != null && Model.baseFiles.Count() > 0)
                        {
                            foreach (var item in Model.baseFiles)
                            {
                                index++;
                                <tr id="${obj.GuidId}">
                                    <td><span class="font-black">@index</span></td>
                                    <td class="text_lf td-div"><span class="font-black">@item.Name</span></td>
                                    <td><span class="font-black">@item.TypeName</span></td>
                                    <td class="td-div" style="text-align:center">
                                        <a class="fileDel downloadFile" href="javascript:void(0)" data-url="@item.Url" data-name="@item.Name" style="color:#337ab7;">下载</a>
                                    </td>
                                </tr>
                            }
                        }
                    }
                </tbody>
            </table>

        </div>

        <div class="layui-form-item  btn-save" style="margin-top:60px;text-align:center;">
            <input type="button" id="close" value="返&nbsp;&nbsp;&nbsp;回" class="layui-btn layui-btn-big " />
            <input type="hidden" name="State" id="State" />
        </div>
    </form>
</div>

<script>
    $("#close").click(function () {
        window.location.href = "/Company/ContractorIndex";
    });
    //下载附件
    $("body").on("click", ".downloadFile", function () {
        var path = $(this).data("url");
        var fileName = $(this).data("name");
        window.location.href = "/Download/DownLoadHB?path=" + path + "&fileName=" + fileName;
    });
</script>

